package com.platform.service.impl;

import com.platform.dao.InviteDao;
import com.platform.entity.InviteEntity;
import com.platform.service.InviteService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Service("inviteService")
public class InviteServiceImpl implements InviteService{
    @Autowired
    private InviteDao inviteDao;

    @Override
    public InviteEntity queryObject(Integer id) {
        return inviteDao.queryObject(id);
    }

    @Override
    public List<InviteEntity> queryList(Map<String, Object> map) { return inviteDao.queryList(map); }

    @Override
    public int queryTotal(Map<String, Object> map) { return inviteDao.queryTotal(map); }

    @Override
    public int queryByInvitation(String invitation) { return inviteDao.queryByInvitation(invitation); }

    @Override
    public InviteEntity queryByUserId(Integer userId) { return inviteDao.queryByUserId(userId); }

    @Override
    public int save(InviteEntity inviteEntity) {
        inviteEntity.setCreateTime(new Date());
        return inviteDao.save(inviteEntity);
    }

    @Override
    public int update(InviteEntity inviteEntity) {
        return inviteDao.update(inviteEntity);
    }

    @Override
    public int delete(Integer id) {
        return inviteDao.delete(id);
    }
}
